<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>星号画矩形</title>
   <script type="text/javascript">
     function run(){
       var a;
       var b;
       var c="";
       b=document.getElementById("n1").value;
       a=document.getElementById("n2").value;
       for (var i=0; i<a; i++){
         for (var j=0; j<b; j++){
           c+="*";
         }
         c+="<br/>"
     }
      document.getElementById("show_block").innerHTML=c;
    }
     </script>
  <style>
    .font{
    }
  </style>
</head>
<body>
<div>请输入单行星数：<input  id="n1"></div>
<div>请输入行数:<input  id="n2"></div>
<input id="run" type="button" value="执行" onclick="run()">
<hr>
<div id="show_block"></div>
</body>
</html>